package top.jianx.storage.dto;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.InputStream;
import java.io.Serializable;

/**
 * 〈文件基本信息〉
 *
 * @author: Jianx
 * @date: 2022/3/20
 * @since: 1.0.0
 */
@Data
@Accessors(chain = true)
public class BaseFile implements Serializable {

    /**
     * 文件名
     */
    private String fileName;
    /**
     * 原始文件名
     */
    private String originalFileName;
    /**
     * 桶名
     **/
    private String bucketName;
    /**
     * oss文件地址
     **/
    private String filePath;
    /**
     * MIME类型格式的content-type标头
     **/
    private String contentType;
    /**
     * 文件后缀
     **/
    private String fileExtension;
    /**
     * 对象内容的大小
     **/
    private Long contentLength;
    /**
     * 文件内容
     **/
    private byte[] objectContent;
    /**
     * 文件流
     **/
    private InputStream inputStream;

    @Override
    public String toString() {
        return "BaseFile{" +
                "fileName='" + fileName + '\'' +
                ", originalFileName='" + originalFileName + '\'' +
                ", bucketName='" + bucketName + '\'' +
                ", filePath='" + filePath + '\'' +
                ", contentType='" + contentType + '\'' +
                ", fileExtension='" + fileExtension + '\'' +
                ", contentLength=" + contentLength +
                '}';
    }
}
